//---------------------------------------------------------
//	GLOBAL VARIABLES
//---------------------------------------------------------
var newwin, newpop;
// default values
var popWinName="popWin";
var newWinName="newWin";
var popWidth=300;
var popHeight=300;
var newWinWidth=600;
var newWinHeight=600;
var reSize = "yes";

function popUp(filename){
	var argv=popUp.arguments;  
	var argc=argv.length;  
	var name=(argc>1) ? argv[1] : popWinName;  
	var w=(argc>2) ? argv[2]:popWidth;
	var h=(argc>3) ? argv[3]:popHeight;
	var s=(argc>4) ? argv[4]:reSize;
	var scroll=(argc>5) ? argv[5]:"no";
	var nTop = (screen.height / 2) - (h / 2);
	var nLeft = (screen.width / 2) - (w / 2);
	var left=(argc>6) ? argv[6]:nLeft;
	var top=(argc>7) ? argv[7]:nTop;
	if(!newpop||newpop.closed) {
		newpop=window.open(filename, name, "toolbar=no,width="+w+",height="+h+",menubar=no,resizable="+s+",status=no,scrollbars="+scroll+",left="+left+",top="+top);
	} else {
		newpop.location =  filename;
		newpop.focus();
	}
};

var timer = null

function stop()
{
clearTimeout(timer)
}

function start() {

	var MONTH_NAMES = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
	var DAY_NAMES = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

	var now = new Date();
	
	var month = MONTH_NAMES[now.getMonth()];
	var dayOfWeek = DAY_NAMES[now.getDay()];
	var dayOfMonth = now.getDate(); 
	var year = now.getFullYear();
	var hours = now.getHours();
	var minutes = now.getMinutes();
	if (minutes < 10) {
		minutes = "0" + minutes.toString();
	}
	
	// convert military time to standard time format
	if (hours >= 12) {
		am_pm_indicator = "PM";
		if (hours != 12) {hours = hours - 12;}
	} else {
		am_pm_indicator = "AM";
		if (hours == 0) {hours = 12;}
	}

	var dateDisplay = dayOfWeek + ', ' + month + ' ' + dayOfMonth + ', ' + year + ' ' + hours + ':' + minutes + ' ' + am_pm_indicator;

	document.all.dateTime.innerHTML = dateDisplay;
	timer = setTimeout("start()",60000)
}

function hideNavigation()
{
	sideNavTable.style.display='none';
}
function collapseNavigation()
{
	// Fix for FireFox, replace inline with ''
	//openNavTable.style.display='inline';
	openNavTable.style.display='';
	navTable.style.display='none';
}
function expandNavigation()
{
	// Fix for FireFox, replace inline with ''
	//navTable.style.display='inline';
	navTable.style.display='';
	openNavTable.style.display='none';

}

function appendValueToLaunchTool(action, parameterName, value){
    location.href= action + '&' + parameterName + '=' + value;
}

function launchToolCallBack(e, action, parameterName, value) {

	// Adjustements for IE and Firefox events
	var evt = null;
	var theKeyPressed = null;
	if (window.event) {
		evt = window.event
		theKeyPressed = evt.keyCode;
	} else {
		evt = e;
		theKeyPressed = e.which;
	}

	if (theKeyPressed == 13) {
		appendValueToLaunchTool(action, parameterName, value);
	}
}

// b08shf 9/21/04
function quickLink(url, newWindow){
	if (url != "") {
		if (newWindow) {
			window.open(url);
		} else {
			location.href = url;
		}
    }
}
// end b08shf 9/21/04
